package com.woniuxy.purchasemanager.controller;

import com.alibaba.excel.ExcelWriter;
import com.woniuxy.commons.entity.sale.vo.sale.SoAccountVo;
import com.woniuxy.commons.result.Result;
import com.woniuxy.purchasemanager.service.SoAccountFileService;
import com.woniuxy.purchasemanager.service.impl.SoAccountFileServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO:
 * <P> Date: 2022/4/25:16:16
 * <P> Description:
 */
@RequestMapping("/need/soaccountFile")
@RestController
public class SoAccountController {

    @Resource
    private SoAccountFileService service;

    @GetMapping("/soaccount/file/{currentPage}/{limit}")
    public String exportDataToExcel(HttpServletResponse response,
                                                 @PathVariable("currentPage") Integer currentPage,
                                                 @PathVariable("limit") Integer limit
                                                ) {
        service.findChooseProduceBySoIdAsExce(response,currentPage,limit,new SoAccountVo());
        return "Result.ok()";
    }
}
